#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// PandoraFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion
using UnityEditor;

namespace PandoraEditor
{
    public static class AtlasImport
    {
        public static void SetPlatformSetting(TextureImporter textureImporter, TextureImporterFormat format = TextureImporterFormat.ASTC_4x4)
        {
            string[] platformArray = {"iPhone", "android", "webgl"};
            TextureImporterPlatformSettings settings = new TextureImporterPlatformSettings();
            settings.overridden = true;
            settings.format = format;
            foreach (var platformName in platformArray)
            {
                settings.name = platformName;
                textureImporter.SetPlatformTextureSettings(settings);
            }
            textureImporter.SaveAndReimport();
        }
    }
}